export const listOption = {
  border: true,
  stripe: true,
  menuAlign: "center",
  index: true,
  searchSpan: 7,
  indexLabel: "序号",
  editBtn: false,
  labelWidth: "200",
  delBtn: false,
  searchMenuSpan: 6,
  align: "center",
  addBtn: false,
  column: [{
      label: "创建时间",
      prop: "create_time",
      addDisplay: false,
      editDisplay: false,
      span: 24,
      search: true,
      searchslot:true,
      searchSpan: 11,
      rules: [{
        required: true,
        message: "请输入"
      }]
    }, 
    {
      label: "企业名称",
      span: 24,
      type: "select",
      hide: true,
      dicFlag: true,
      searchFilterable: true,
      search: true,
      dicUrl: process.env.VUE_APP_BASE_API + "/admin/company/listAll?status=all",
      dicFormatter: res => {
        return (res.data || []).map(o => ({
          label: o.company_name,
          value: o.id
        }));
      },
      props: {
        label: "label",
        value: "value"
      },
      rules: [{
        required: true,
        message: "请输入"
      }],
      prop: "id"
    },{
      label: "企业名称",
      prop: "company_name",
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "可用余额（元）",
      prop: "balance",
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },

    {
      label: "冻结余额（元）",
      prop: "freeze",
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "累计月支出",
      prop: "out",
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "累计月交易次数",
      prop: "length",
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "企业状态",
      prop: "status",
      type: "radio",
      addDisplay: false,
      editDisplay: false,
      dicData: [{
          label: "正常",
          value: 0
        },
        {
          label: "冻结",
          value: 1
        }
      ],
      span: 24
    }
  ]
};


export const audioOption = {
  border: true,
  stripe: true,
  menuAlign: "center",
  index: true,
  indexLabel: "序号",
  searchSpan: 7,
  editBtn: false,
  labelWidth: "200",
  delBtn: false,
  selection: true,
  selectable:(row,index)=>{
    return row.status===0;
  },
  searchMenuSpan: 6,
  align: "center",
  addBtn: false,
  column: [{
      label: "创建时间",
      prop: "create_time",
      addDisplay: false,
      editDisplay: false,
      search: true,
      searchslot:true,
      searchSpan: 11,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    }, {
      label: "企业名称",
      prop: "company_name",
      addDisplay: false,
      editDisplay: false,
      span: 24,
      type: "select",
      dicFlag: true,
      searchFilterable: true,
      search: true,
      dicUrl: process.env.VUE_APP_BASE_API + "/admin/company/listAll?status=all",
      dicFormatter: res => {
        return (res.data || []).map(o => ({
          label: o.company_name,
          value: o.id
        }));
      },
      props: {
        label: "label",
        value: "value"
      },
      rules: [{
        required: true,
        message: "请输入"
      }],
      prop: "company_id"
    },
    {
      label: "充值金额",
      prop: "money",
      addDisplay: false,
      editDisplay: false,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "审核状态",
      prop: "status",
      type: "radio",
      dicData: [{
          label: "待审核",
          value: 0
        },
        {
          label: "通过",
          value: 1
        },
        {
          label: "拒绝",
          value: 2
        }
      ],
      rules: [{
        required: true,
        message: "请输入"
      }],
      span: 24
    },
    {
      label: "企业状态",
      prop: "company_status",
      type: "radio",
      addDisplay: false,
      editDisplay: false,
      dicData: [{
          label: "正常",
          value: 0
        },
        {
          label: "冻结",
          value: 1
        }
      ],
      span: 24
    },
    {
      label: "备注",
      prop: "remark",
      span: 24
    }
  ]
};


export const rechargeOption = {
  submitText: '提交',
  emptyText: '取消',
  column: [{
      label: "企业名称",
      span: 24,
      disabled: true,
      rules: [{
        required: true,
        message: "请输入"
      }],
      prop: "company_name"
    }, {
      label: "充值金额",
      prop: "money",
      type: "number",
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "上传凭证",
      prop: 'img',
      span: 24,
      type: 'upload',
      listType: 'picture-img',
      tip: '请上传JPG图片，大小不要超过1M',
      oss: 'qiniu',
      propsHttp: {
        name: 'hash',
        url: "key"
      },
      rules: [{
        required: true,
        message: "请上传"
      }],
    }
  ]

}



export const rechargeAudit = {
  submitText: '提交',
  emptyText: '取消',
  column: [{
      label: "充值金额",
      prop: "money",
      type: "number",
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "上传凭证",
      prop: 'img',
      span: 24,
      type: 'upload',
      listType: 'picture-img',
      tip: '请上传JPG图片，大小不要超过1M',
      oss: 'qiniu',
      propsHttp: {
        name: 'hash',
        url: "key"
      },
      rules: [{
        required: true,
        message: "请上传"
      }],
    }
  ]

}


export const detailOption = {
  border: true,
  menuAlign: "center",
  labelWidth: "200",
  addBtn: false,
  menu: false,
  searchLabelWidth: 100,
  searchMenuSpan: 6,
  searchSpan: 10,
  searchMenuSpan: 6,
  align: "center",
  column: [{
      label: "月份",
      prop: "time",
      addDisplay: false,
      editDisplay: false,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    }, {
      label: "创建时间",
      prop: "create_time",
      startPlaceholder: '日期开始范围自定义',
      endPlaceholder: '日期结束范围自定义',
      addDisplay: false,
      editDisplay: false,
      searchslot: true,
      search: true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "类型",
      prop: "type",
      type: "radio",
      dicData: [{
          label: "工资支出",
          value: 1
        },
        {
          label: "费用支出",
          value: 2
        },
        {
          label: "工资返还",
          value: 3
        },
        {
          label: "费用返还",
          value: 4
        },
        {
          label: "充值",
          value: 5
        }
      ],
      rules: [{
        required: true,
        message: "请输入"
      }],
      span: 24
    },
    {
      label: "金额",
      prop: "total",
      span: 24
    },
    {
      label: "可用余额",
      prop: "balance",
      span: 24
    }
  ]
};


export const recordOption = {
  border: true,
  stripe: true,
  menuAlign: "center",
  index: true,
  selection: true,
  selectable:(row,index)=>{
    return row.invoice_status===1;
  },
  searchSpan: 7,
  indexLabel: "序号",
  editBtn: false,
  editTitle: '发票',
  updateBtnText: '提交',
  labelWidth: "200",
  delBtn: false,
  searchMenuSpan: 6,
  align: "center",
  addBtn: false,
  showSummary: true,
  sumColumnList: [
    {
      label:'',
      name: 'money',
      type: 'sum',
    }
  ],
  column: [{
      label: "创建时间",
      prop: "create_time",
      addDisplay: false,
      editDisplay: false,
      span: 24,
      searchslot:true,
      searchSpan: 11,
      rules: [{
        required: true,
        message: "请输入"
      }]
    }, 
    {
      label: "企业名称",
      span: 24,
      type: "select",
      dicFlag: true,
      addDisplay: false,
      editDisplay: false,
      searchFilterable: true,
      search: true,
      dicUrl: process.env.VUE_APP_BASE_API + "/admin/company/listAll?status=all",
      dicFormatter: res => {
        return (res.data || []).map(o => ({
          label: o.company_name,
          value: o.id
        }));
      },
      props: {
        label: "label",
        value: "value"
      },
      rules: [{
        required: true,
        message: "请输入"
      }],
      prop: "company_id"
    },
    {
      label: "充值金额（元）",
      prop: "money",
      addDisplay: false,
      editDisplay: false,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "审核状态",
      prop: "status",
      type: "radio",
      addDisplay: false,
      editDisplay: false,
      span: 24,
      dicData: [{
          label: "待审核",
          value: 0
        },
        {
          label: "通过",
          value: 1
        },
        {
          label: "拒绝",
          value: 2
        }
      ]
    },
    {
      label: "发票状态",
      prop: "invoice_status",
      addDisplay: false,
      editDisplay: false,
      span: 24,
      type: "radio",
      dicData: [{
          label: "未开票",
          value: 0
        },
        {
          label: "申请中",
          value: 1
        },
        {
          label: "已开票",
          value: 2
        },
        {
          label: "已驳回",
          value: 3
        }
      ]
    },{
      label: "企业名称",
      prop: "invoice_c_name",
      hide: true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },{
      label: "公司税号",
      prop: "invoice_c_num",
      hide: true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },{
      label: "发票类型",
      prop: "invoice_type",
      hide: true,
      span: 24,
      rules: [{
        required: true,
        message: "请选择"
      }],
      type: "radio",
      dicData: [{
          label: "专票",
          value: '1'
        },
        {
          label: "普票",
          value: '2'
        }
      ]
    },
    {
      label: "发票内容",
      span: 24,
      type: "select",
      dicFlag: true,
      searchFilterable: true,
      hide: true,
      dicUrl: process.env.VUE_APP_BASE_API + "/admin/dict/find?type=invoice_content",
      dicFormatter: res => {
        return (res.data || []).map(o => ({
          label: o.label,
          value: o.value
        }));
      },
      props: {
        label: "label",
        value: "value"
      },
      rules: [{
        required: true,
        message: "请输入"
      }],
      prop: "invoice_content"
    },{
      label: "收件地址",
      prop: "invoice_addr",
      hide: true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },{
      label: "收件人",
      prop: "invoice_person",
      hide: true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },{
      label: "收件人电话",
      prop: "invoice_phone",
      hide: true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    }
  ]
};





export const recordAudit = {
  emptyBtn:false,
  submitBtn:false,
  column: [
    {
      label: "企业名称",
      prop: "invoice_c_name",
      detail:true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },{
      label: "公司税号",
      prop: "invoice_c_num",
      detail:true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },{
      label: "发票类型",
      prop: "invoice_type",
      detail:true,
      span: 24,
      rules: [{
        required: true,
        message: "请选择"
      }],
      type: "radio",
      dicData: [{
          label: "专票",
          value: '1'
        },
        {
          label: "普票",
          value: '2'
        }
      ]
    },
    {
      label: "发票内容",
      span: 24,
      type: 'select',
      detail:true,
      dicFlag: true,
      searchFilterable: true,
      dicUrl: process.env.VUE_APP_BASE_API + "/admin/dict/find?type=invoice_content",
      dicFormatter: res => {
        return (res.data || []).map(o => ({
          label: o.label,
          value: o.value
        }));
      },
      props: {
        label: "label",
        value: "value"
      },
      rules: [{
        required: true,
        message: "请输入"
      }],
      prop: "invoice_content"
    },{
      label: "收件地址",
      prop: "invoice_addr",
      detail:true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },{
      label: "收件人",
      prop: "invoice_person",
      detail:true,
      span: 24,
      rules: [{
        required: true,
        message: "请输入"
      }]
    },
    {
      label: "上传发票",
      prop: 'invoice_img',
      span: 24,
      type: 'upload',
      tip: '请上传发票文件',
      limit: 1,
      oss: 'qiniu',
      propsHttp: {
        name: 'hash',
        url: "key"
      },
      rules: [{
        required: true,
        message: "请输入"
      }],
    }
  ]
}